package com.example.myapplication

import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.widget.Button
import androidx.activity.ComponentActivity

class MainActivity : ComponentActivity() {
    val handler = Handler(Looper.getMainLooper())
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setTheme(R.style.Theme_MyApplication);//恢复原有的样式
        setContentView(R.layout.layout)
        var btn = findViewById<Button>(R.id.btn)
        btn.setOnClickListener {
            var intent = Intent()
            var t = this;
            intent.setClass(t, MainActivity2::class.java)
            startActivity(intent)
        }

        var btn2 = findViewById<Button>(R.id.bt2)
        btn2.setOnClickListener {
            var intent = Intent()
            var t = this;
            intent.setClass(t, MainActivity4::class.java)
            startActivity(intent)
        }
    }

    override fun onResume() {
        super.onResume()

//        handler.postDelayed({
//            Log.i("AZKKK", "setTheme")
//
//        }, 2000)
    }
}
